<div class="form">
    <?php
    $form = $this->beginWidget('GxActiveForm', array(
        'id' => 'page-content-form',
        'enableAjaxValidation' => false,
        'htmlOptions' => array(
            'enctype' => 'multipart/form-data',
            'enableClientValidation' => true
        ),
    ));
    ?>

    <p class="note">
        <?php echo Yii::t('app', 'Fields with'); ?> <span class="required">*</span> <?php echo Yii::t('app', 'are required'); ?>.
    </p>

    <?php if (PageType::model()->count()): ?>
        <?php
        $parents = PageType::model()->findAll('parent_id=0 AND status=1');
        $cm = new CommonCategoryMethods();
        $data = $cm->makeDropDown($parents);
        ?>

        <div class="row">
            <div class="rowLabel"><?php echo $form->labelEx($model, 'page_type_id'); ?> </div>
            <div class="rowControl"> <?php echo $form->dropDownList($model, 'page_type_id', $data, array('class' => 'selectbox')); ?>
                <?php echo $form->error($model, 'page_type_id'); ?>
            </div>	 
        </div>	

    <?php endif ?>



    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'page_title'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($model, 'page_title', array('maxlength' => 145)); ?>
            <?php echo $form->error($model, 'page_title'); ?>
        </div><!-- row -->
    </div>
    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'meta_tag'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textField($model, 'meta_tag', array('maxlength' => 145)); ?>
            <?php echo $form->error($model, 'meta_tag'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'meta_description'); ?>
        </div>
        <div class="rowControl"><?php echo $form->textArea($model, 'meta_description'); ?>
            <?php echo $form->error($model, 'meta_description'); ?>
        </div><!-- row -->
    </div>

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'page_content'); ?>
        </div>
        <div style="clear:both"></div>
        <div class="rowControl">
            <?php
            $this->widget('application.extensions.ckeditor.CKEditor', array(
                'model' => $model,
                'attribute' => 'page_content',
                'language' => 'en',
            ));
            ?>


            <?php echo $form->error($model, 'page_content'); ?>
        </div><!-- row -->
    </div>
    

    <div class="row">
        <div class="rowLabel"><?php echo $form->labelEx($model, 'photo_name'); ?>
        </div>
        <div class="rowControl"><?php echo $form->fileField($model, 'photo_name'); ?>
            <?php echo $form->error($model, 'photo_name'); ?>
            <?php if (!empty($model->photo_name)) { ?>
                <img style="width: 50px;height: 50px;float: right;margin-top: -40px;;"class="media-object" src="<?php echo (!empty($model->photo_name)) ? Yii::app()->request->baseUrl . ECSconfig::getUploadDir() . 'cms-images/' . $model->photo_name : ''; ?>" alt="">
                <a style="float: right;margin: 10px -46px -18px 0px;color: red;"href="<?php echo Yii::app()->createAbsoluteUrl('pageContent/deleteimage/id/'.$model->id) ?>">Delete</a>
            <?php } ?>
        </div><!-- row -->
    </div>
 <div class="gap"></div>
    <div class="row">
        <?php
        echo GxHtml::submitButton(Yii::t('app', 'Save'), array('class' => 'read-more pull-left'));
        $this->endWidget();
        ?>
    </div>
</div>
<!-- form -->
<div class="gap"></div>
<div class="gap"></div>  

</div>
<div class="col-lg-2"></div>
</div>
</div>
</div>
</div>

</div>
</section>
<div class="gap"></div>
<div class="gap"></div>